<template>
  <div class="modify-dialog">
    <slot> </slot>
    <el-dialog v-bind="dialogOpts" :visible.sync="dialogVisible">
      <div class="page-wrap" style="height: 65vh">
        <Table
          :pagination="false"
          v-bind="tableOpts"
          defaultExpandAll
          v-on="tableEvent"
        >
        </Table>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import modifyMixins from "@/mixins/modifyMixins.vue";
import tableMixins from "@/mixins/tableMixins.vue";

export default {
  name: "AftersaleMaterials",
  mixins: [tableMixins, modifyMixins],
  data() {
    return {
      apiName: "afterSaleAfterSaleDetail",
      dialogWidth: "80vw",
      form: {
        id: {
          tag: "el-input",
          label: "订单编号",
          value: "",
          props: {
            clearable: true,
            placeholder: "请输入订单编号",
          },
        },
      },
    };
  },
  computed: {
    title() {
      return "售后明细";
    },
  },
  mounted() {},
  methods: {
    showDialog(modify = "add", row = {}) {
      this.dialogVisible = true;
      this.row = row;
      this.fetchCurrentTable();
    },
    formatQuery(opts) {
      const { date = [], ...params } = opts;
      if (date && date[0] && date[1]) {
        params.startTime = dayjs(date[0]).format("YYYY-MM-DD HH:mm:ss");
        params.endTime = dayjs(date[1]).format("YYYY-MM-DD HH:mm:ss");
      }
      params.afterSaleId = this.row.afterSaleId;
      return params;
    },
  },
};
</script>

<style lang="less" scoped>
:deep(.el-table__expanded-cell) {
  padding: 0;
}
</style>
